<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
</head>

<body>
    <div id="app" class="container">
        
        <table class="table table-hover">
            <caption>购物车</caption>
            <thead>
                <tr>
                    <th>

                        <input type="checkbox" :checked="allchecked">
                        全选
                    </th>
                    <th>序号</th>
                    <th>商品</th>
                    <th>单价</th>
                    <th>数量</th>
                    <th>单品总价</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item,index) in goods">
                    <td>
                        <input type="checkbox" :checked="item.iscreat">
                    </td>
                    <td>
                       
                        {{index+1}}
                    </td>
                    <td>{{item.title}}</td>
                    <td>{{item.price}}</td>
                    <td>{{item.num}}</td>
                    <td>{{item.price*item.num}}</td>
                </tr>
            </tbody>
        </table>


    </div>
</body>
<script src="./vue.min.js"></script>
<script>
    new Vue({
        el: "#app",
        data: {
            name: "",
            password: "",
            allchecked:false,
            goods: [
                {
                    title: "鞋",
                    num: 1,
                    price: 20,
                    iscreat: false
                },
                {
                    title: "手机",
                    num: 1,
                    price: 100,
                    iscreat: true
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: true
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: false
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: true
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: false
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: false
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: false
                },
                {
                    title: "帽子",
                    num: 1,
                    price: 10,
                    iscreat: false
                }
            ]
        }
    })

</script>

</html>